//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.eResearch.Publisher.Interfaces
{
    using System;
    using Microsoft.Research.eResearch.Blackboard.Common;

    /// <summary>
    /// Implementers of this interface provide code that registers and unregisters with 
    /// the blackboard, and posts new blackboard messages.
    /// </summary>
    public interface IPublisherMessageSender
    {
        /// <summary>
        /// Registers the specified return address (location of the IPublisherSubscriptionReceiver) with
        /// the blackboard, and obtains the intial subscription profile.
        /// </summary>
        /// <param name="returnAddress">The return address of the publisher.</param>
        /// <returns>The initial subscription profile for the publisher.</returns>
        SubscriptionProfile Register(Uri returnAddress);

        /// <summary>
        /// Unregisters the specified return address of the publisher from the blackboard.
        /// </summary>
        /// <param name="returnAddress">The return address of the publisher.</param>
        void Unregister(Uri returnAddress);

        /// <summary>
        /// Publishes the specified message to the blackboard.
        /// </summary>
        /// <param name="message">The blackboard message.</param>
        void Publish(BlackboardMessage message);
    }
}
